<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>上传<?php echo $cInfos['typename']; ?></title>
<?php include(DEDEMEMBER."/templets/head_inc.htm"); ?>
<script type="text/javascript" language='javascript' src='js/main.js'></script>
<script language="javascript" type="text/javascript">
<!--
function checkSubmit()
{

	if(document.form1.title.value==""){
		alert("文章标题不能为空！");
		document.form1.title.focus();
		return false;
	}

	if(document.form1.typeid.value==0){
		alert("文章隶属栏目必须选择！");
		return false;
	}

	if(document.form1.typeid.options[document.form1.typeid.selectedIndex].className!='option3')
	{
		alert("文章隶属栏目必须选择白色背景的项目！");
		return false;
	}

	if(document.form1.vdcode.value==""){
		document.form1.vdcode.focus();
		alert("验证码不能为空！");
		return false;
	}

}

var startNum = 2;
function MakeUpload()
{
	var upfield = document.getElementById("uploadfield");
	var morelinkobj = document.getElementById("morelink");
	var endNum =  parseInt(document.form1.picnum.value) + startNum;
	morelinkobj.style.display = "block";
	if(endNum>12) endNum = 12;
	for(startNum;startNum<=endNum;startNum++){
		upfield.innerHTML += "<div class='mT10'>";
		upfield.innerHTML += "软件地址"+startNum+"：<input class='text' type='text' name='softurl"+startNum+"' value='http://'> ";
		upfield.innerHTML += " ";
		upfield.innerHTML += "服务器名称：<input class='text' type='text' name='servermsg"+startNum+"' style='width:150px'>\r\n";
		upfield.innerHTML += "</div>";
	}
}

function ShowHideAddr()
{
	document.getElementById('morelink').style.display = (document.getElementById('morelink').style.display=='block' ? 'none' : 'block');
	document.getElementById('btsh3').value = (document.getElementById('morelink').style.display=='block' ? '隐藏地址' : '显示地址');
}

-->
</script>
</head>
<body>
<?php include(DEDEMEMBER."/templets/head.htm"); ?>
<div class="wrapper lineT">
  <div class="mainBox">
    <div class="main">
      <?php include(DEDEMEMBER."/templets/menu.php"); ?>
      <div class="dedeMain">
        <div class="location"><span class="titAddChannel3 icon">上传</span><?php echo $cInfos['typename']; ?></div>
        <form class="mTB10 mR10 mL10" name="form1" action="soft_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
          <input type="hidden" name="dopost" value="save" />
          <input type="hidden" name="channelid" value="<?php echo $channelid; ?>" />
          <table cellspacing="1" class="submit mB10">
            <thead>
              <tr>
                <th colspan="4" ><strong>常规参数</strong></th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td width="15%" align="right"><?php echo $cInfos['typename']; ?>名称：</td>
                <td colspan="3"><input name="title" type="text" id="title" class="text" size="30" style="width:400px;" />
                  <span style="color:#F00">*</span></td>
              </tr>
              <tr>
                <td align="right">标签TAG：</td>
                <td colspan="3"><input name="tags" type="text" id="tags" size="30" class="text" style='width:400px' />
                  (用逗号分开)</td>
              </tr>
              <tr>
                <td align="right">作者：</td>
                <td colspan="3"><input name="writer" type="text" id="writer" size="30" style="width:95px;" class="text" value="<?php echo $cfg_ml->M_UserName?>" /></td>
              </tr>
              <tr>
                <td align="right">文件类型：</td>
                <td><select name="filetype" id="filetype" style="width:100px">
                    <option value=".exe" selected="selected">.exe</option>
                    <option value=".zip">.zip</option>
                    <option value=".rar">.rar</option>
                    <option value=".iso">.iso</option>
                    <option value=".gz">.gz</option>
                    <option value="其它">其它</option>
                  </select></td>
                <td width="15%" align="right">界面语言：</td>
                <td><select name="language" id="language" style="width:100px">
                    <option value="简体中文" selected="selected">简体中文</option>
                    <option value="英文软件">英文软件</option>
                    <option value="繁体中文">繁体中文</option>
                    <option value="其它类型">其它类型</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right">软件类型：</td>
                <td><select name="softtype" id="softtype" style="width:100px">
                    <option value="国产软件" selected="selected">国产软件</option>
                    <option value="国外软件">国外软件</option>
                    <option value="汉化补丁">汉化补丁</option>
                  </select></td>
                <td align="right">授权方式：</td>
                <td><select name="accredit" id="accredit" style="width:100px">
                    <option value="共享软件" selected="selected">共享软件</option>
                    <option value="免费软件">免费软件</option>
                    <option value="开源软件">开源软件</option>
                    <option value="商业软件">商业软件</option>
                    <option value="破解软件">破解软件</option>
                    <option value="游戏外挂">游戏外挂</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right">运行环境：</td>
                <td><input class="text" type='text' name='os' value='Win2003,WinXP,Win2000,Win9X' /></td>
                <td align="right">软件等级：</td>
                <td><select name="softrank" id="softrank" style="width:100px">
                    <option value="1">一星</option>
                    <option value="2">二星</option>
                    <option value="3" selected="selected">三星 </option>
                    <option value="4">四星</option>
                    <option value="5">五星</option>
                  </select></td>
              </tr>
              <tr>
                <td align="right">官方网址：</td>
                <td><input class="text" name="officialUrl" type="text" id="officialUrl" value="http://" /></td>
                <td align="right">程序演示：</td>
                <td><input class="text" name="officialDemo" type="text" id="officialDemo" /></td>
              </tr>
              <tr>
                <td align="right">软件大小：</td>
                <td><input class="text" name="softsize" type="text" id="softsize" style="width:95px" />
                  <select name="unit" id="unit">
                    <option value="MB" selected="selected">MB</option>
                    <option value="KB">KB</option>
                    <option value="GB">GB</option>
                  </select></td>
                <td align="right">软件来源：</td>
                <td><input class="text" name="source" type="text" id="source" /></td>
              </tr>
              <tr>
                <td align="right">隶属栏目：</td>
                <td>
   <?php
    $typeOptions = GetOptionList(0,$channelid);
    echo "<select name='typeid' size='1'>\r\n";
    echo "<option value='0' selected>请选择栏目...</option>\r\n";
    echo $typeOptions;
    echo "</select>";
	?>
                  <span style="color:#F00">*</span>
                 </td>
                 <td align="right">需要金币：</td>
                 <td><input class="text" name="needmoney" type="text" value="0" id="needmoney" style="width:95px" />(最大允许100个)</td>
              </tr>
              <tr>
                <td align="right">缩略图：</td>
                <td colspan="3"><input name="litpic" type="file" id="litpic" style="width:408px" onchange="SeePicNew('divpicview',this);"  />
                  <div id='divpicview' class='divpre'></div></td>
              </tr>
              <?php
      //自定义字段
      PrintAutoFieldsAdd($cInfos['fieldset'],'autofield');
      ?>
            </tbody>
          </table>
          <table cellspacing="1" class="submit">
            <thead>
              <tr>
                <th colspan="2" ><strong>软件详情</strong></th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td width="15%" align="right">文字介绍：</td>
                <td><?php GetEditor("body","",200,"Member"); ?></td>
              </tr>
              <tr>
                <td align="right">本地地址：</td>
                <td><input class="text" name="softurl1" type="text" id="softurl1" size="35" />
                  <button class="buttonGary2" name="sel1" type="button" id="sel1" onclick="SelectSoft('form1.softurl1')">选取</button>
                  服务器名称：
                  <input class="text" name="servermsg1" type="text" id="servermsg1" value="本地下载" style="width:150px" /></td>
              </tr>
              <tr>
                <td align="right">其它地址：</td>
                <td><input class="text" name="picnum" type="text" id="picnum" size="8" value="5" />
                  <button class="buttonGary4" name='kkkup' type='button' id='kkkup2' onclick="MakeUpload();">增加地址</button>
                  <button class="buttonGary4 mL10" type="button" name="Submit3" id="btsh3" onclick="ShowHideAddr();">隐藏地址</button>
                  (最多为12个链接)
                  <div id="morelink" style="display:none"><?php echo "<span id='uploadfield'></span>"; ?></div></td>
              </tr>
              <?php
     //游客强制加验证码，会员则判断后台开关
     if(!$cfg_ml->IsLogin() || $cfg_vdcode_member=='Y')
     {
      ?>
              <tr>
                <td align="right">验证码：</td>
                <td><input name="vdcode" type="text" id="vdcode" size="10" class="text" style='width:50px;text-transform:uppercase;' />
                  <img src='../include/vdimgck.php' width='50' height='20' align="absmiddle" alt="看不清？点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" /></td>
              </tr>
              <?php
     }
     else
     {
     	echo "<input name='vdcode' type='hidden' id='vdcode' value='notuse' />";
     }
      ?>
            </tbody>
            <tfoot>
              <tr>
                <td height="45">&nbsp;</td>
                <td height="45"><button class="button2" type="submit">提交</button>
                  <button class="button2 mL10" type="reset" onclick="location.reload();">重置</button></td>
              </tr>
            </tfoot>
          </table>
        </form>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
</body>
</html>
